<%@page import="java.util.ArrayList"%>
<%@page import="bean.MemberVo"%>
<%@page import="bean.MemberDTO"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src='./js/member.js'></script>
<link rel='stylesheet' href='./member/member.css'>
<title>Insert title here</title>
</head>
<body>
	<%
		request.setCharacterEncoding("utf-8");
	%>
	<jsp:useBean id="vo" class='bean.MemberVo' scope='page' />
	<jsp:setProperty property="*" name="vo" />
	<%
	MemberDTO dto =new MemberDTO();
	dto.setVo(vo);
	ArrayList<MemberVo> al = dto.select();
	%>
	
	<h1>회원 List</h1>
	<div id='member_list_find'>
	<form name='member_list_frm' method='post' action='index.jsp?inc=./member/list.jsp'>
			<input type='text' name='find' value='<%=vo.getFind()%>'/> 
			<input type='submit' value='검색' />
		</form>
	</div>

	<div id='member_list_title'>
		<div class='member_list_mid'>아이디</div>
		<div class='member_list_grade'>이름</div>
		<div class='member_list_exam'>이미지</div>
	</div>
	<%for(int a=0; a<al.size();a++){
			MemberVo v=al.get(a);%>

	<div class='member_list_items'>
		<div class='member_list_mid'>
			<a href='#' onclick="goView(<%=dto.getNowPage()%>,'<%=v.getMid()%>')"><%=v.getMid()%></a>
		</div>
		<div class='member_list_grade'><%=v.getIrum() %></div>
		<div class='member_list_exam'><%=v.getPhoto() %></div>
	</div>
	<%}%>
	
	<div id='list_page'>
		<%if(dto.getStartPage() !=1){%>
		<a href='#' onclick='goPage(1)'>맨처음</a>
		<a href='#' onclick='goPage(<%=dto.getStartPage()-1%>)'>이전</a>
		<%}%>
		
		<% 
			int i=0;
			for(i= dto.getStartPage(); i<=dto.getEndPage();i++){%>
			<a href='#' onclick='goPage(<%=i%>)'><%=i%></a>
		<%}%>
			
		<% if(dto.getTotPage() != dto.getEndPage()){%>
			<a href='#' onclick='goPage(<%=i%>)'>다음</a>
		<%}%>

		<a href='#' onclick='goPage(<%=dto.getTotPage()%>)'>맨끝</a>

	</div>
	<input type='button' value='게시판 작성' id='btnInput' />

	<script>listInit();</script>
	<form name='hidfrm' method='post'>
		<input type='hidden' name='nowPage'> 
		<input type='hidden' name='find'> 
		<input type='hidden' name='mid'>
	</form>
</body>
</html>